package com.itheima.vueTest.web.controller;

import com.itheima.vueTest.pojo.PageBean;
import com.itheima.vueTest.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping(value = "/user",name = "用户模块")
public class UserController {

    @Autowired
    private UserService userService;

    //分页查询
    @RequestMapping(value = "/pageQuery.do",name = "查询页面数据")
    public Map<String,Object> pageQuery(@RequestBody PageBean pageBean){
        //System.out.println(pageBean);
        return userService.pageQuery(pageBean);
    }

    //按照id删除user
    @RequestMapping(value = "/deleteUserById.do",name = "查询页面数据")
    public void deleteUserById(int id){

        userService.deleteUserById(id);
    }
}
